<%@page import="models.SolutionAdoption"%>
<%@ page import="com.googlecode.objectify.Objectify, com.googlecode.objectify.ObjectifyService, com.googlecode.objectify.Query" %>
<%@ page import = "controllers.SolutionConnect, controllers.AdoptionConnect" %>
<%@ page import = "models.SolutionSubmission, models.Location" %>
<%@ page import="java.util.*" %>


<graph xaxisname='Benefit' yaxisname='$ Saved' hovercapbg='DEDEBE' hovercapborder='889E6D' rotateNames='0' yAxisMaxValue='100' numdivlines='9' divLineColor='CCCCCC' divLineAlpha='80' decimalPrecision='1' showAlternateHGridColor='1' AlternateHGridAlpha='30' AlternateHGridColor='CCCCCC' caption='Annual Savings' subcaption='' >

<%

Objectify ofy = ObjectifyService.begin();
Query<SolutionSubmission> q = ofy.query(SolutionSubmission.class).filter("Status", "Shared");
float totalSavingsSolution = 0;
 
for ( SolutionSubmission f : q.fetch() ) {
	totalSavingsSolution = totalSavingsSolution + (Float) f.getAnnProdSavings();	
}

Query<SolutionAdoption> qq = ofy.query(SolutionAdoption.class);
float totalSavingsAdoption = 0;
 
for ( SolutionAdoption f : qq.fetch() ) {
	totalSavingsAdoption = totalSavingsAdoption + (Float) f.getAnnProdSavings();	
}

%>

 <categories font='Arial' fontSize='11' fontColor='000000'>
      <category name='Annual Production Savings' hoverText='All Solutions'/>
</categories>


<dataset seriesname='Shared Solutions ' color='FDC12E'>
      <set value='<%=totalSavingsSolution %>' />

</dataset>

<dataset seriesname='Adopted Solutions ' color='0DE12E'>
      <set value='<%=totalSavingsAdoption %>' />
 
</dataset>


</graph>


<!-- 





<graph xaxisname='Benefit' yaxisname='$ Saved' hovercapbg='DEDEBE' hovercapborder='889E6D' rotateNames='0' yAxisMaxValue='100' numdivlines='9' divLineColor='CCCCCC' divLineAlpha='80' decimalPrecision='<Computed Value>' showAlternateHGridColor='1' AlternateHGridAlpha='30' AlternateHGridColor='CCCCCC' caption='Annual Savings' subcaption='' >

 <categories font='Arial' fontSize='11' fontColor='000000'>
      <category name='Annual Production Savings' hoverText='All Solutions'/>
        </categories>


  <dataset seriesname='Shared Solutions ' color='FDC12E'>
      <set value='<Computed Value>' />

</dataset>

  <dataset seriesname='Adopted Solutions ' color='0DE12E'>
      <set value='<Computed Value>' />
 
</dataset>

</graph>


 -->